﻿Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design.Serialization
Imports System.Transactions
Imports System.Workflow.ComponentModel.Serialization

Namespace System.Workflow.ComponentModel
    <DesignerSerializer(GetType(DependencyObjectCodeDomSerializer), GetType(CodeDomSerializer)), Browsable(True)> _
    Public NotInheritable Class WorkflowTransactionOptions
        Inherits DependencyObject
        ' Properties
        <MergableProperty(False), SRDescription("IsolationLevelDescr"), SRCategory("Activity")> _
        Public Property IsolationLevel As IsolationLevel
            Get
                Return DirectCast(MyBase.GetValue(WorkflowTransactionOptions.IsolationLevelProperty), IsolationLevel)
            End Get
            Set(ByVal value As IsolationLevel)
                MyBase.SetValue(WorkflowTransactionOptions.IsolationLevelProperty, value)
            End Set
        End Property

        <SRCategory("Activity"), MergableProperty(False), DefaultValue(GetType(TimeSpan), "0:0:30"), TypeConverter(GetType(TimeoutDurationConverter)), SRDescription("TimeoutDescr")> _
        Public Property TimeoutDuration As TimeSpan
            Get
                Return DirectCast(MyBase.GetValue(WorkflowTransactionOptions.TimeoutDurationProperty), TimeSpan)
            End Get
            Set(ByVal value As TimeSpan)
                MyBase.SetValue(WorkflowTransactionOptions.TimeoutDurationProperty, value)
            End Set
        End Property


        ' Fields
        Public Shared ReadOnly IsolationLevelProperty As DependencyProperty = DependencyProperty.Register("IsolationLevel", GetType(IsolationLevel), GetType(WorkflowTransactionOptions), New PropertyMetadata(IsolationLevel.Serializable, DependencyPropertyOptions.Metadata))
        Public Shared ReadOnly TimeoutDurationProperty As DependencyProperty = DependencyProperty.Register("TimeoutDuration", GetType(TimeSpan), GetType(WorkflowTransactionOptions), New PropertyMetadata(New TimeSpan(0, 0, 30), DependencyPropertyOptions.Metadata))
    End Class
End Namespace

